
package metier;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class AdherentsDao {
        
        static private Adherent [] adherentDB = {
        
                new Adherent("Papon", "Christophe", new GregorianCalendar(1991, Calendar.JULY, 28), "Masculin", 5001, "azeret", "CPMenterau", "01.20.36.89.74"),
                new Adherent("YAHIA", "Amine", new GregorianCalendar(1970, Calendar.JULY, 28), "Masculin", 5002, "azqseft", "Yhasqd","01.20.36.89.74"),
                new Adherent("Papon", "Christophe", new GregorianCalendar(2011, Calendar.JULY, 28), "Masculin", 5003, "azeret", "CPMenterau","01.20.36.89.74" ),
                new Adherent("Papon", "Christophe", new GregorianCalendar(2011, Calendar.JULY, 28), "Masculin", 5004, "azeret", "CPMenterau","01.20.36.89.74" ),
                new Adherent("Papon", "Christophe", new GregorianCalendar(2011, Calendar.JULY, 28), "Masculin", 5005, "azeret", "CPMenterau","01.20.36.89.74" ),
                new Adherent("Papon", "Christophe", new GregorianCalendar(2011, Calendar.JULY, 28), "Masculin", 5006, "azeret", "CPMenterau","01.20.36.89.74" )
                };

        public static Adherent findByKey (int id){
                Adherent ad = null;
                for (Adherent adherent : adherentDB)
                        if((adherent.getIdUtilisateur() ==id)) 
                                ad = new Adherent(adherent.getNom(), adherent.getPrenom(), adherent.getDateNaissance(), adherent.getSexe(), adherent.getIdUtilisateur(), adherent.getPwd(), adherent.getPseudo(),adherent.getTelephone());
                return ad;
        }
}
